<?php 
@session_start();

class AdminView {
	private static function PrepareHeader() {
		echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>ITWorld - Admin Panel</title>
	<link rel="stylesheet" type="text/css" href="css/theme.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css" />
	<script>
		var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
		document.writeln(\'<link rel="stylesheet" type="text/css" href="css/\' + StyleFile + \'">\');
	</script>
	<!--[if IE]>
	<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
	<![endif]-->
</head>';
	}
		
	public static function DisplayHeader() {
		include_once('admin_login.php');
		AdminView::PrepareHeader();
		echo '
<body>
	<div id="container">
    	<div id="header">
        	<h2>ITWorld - Admin Panel</h2>
        	<div id="topmenu">
            	<ul>
                	';
			if(isset($_SESSION['page']) && $_SESSION['page']=='index') 
				echo '<li class="current"><a href="index.php">Strona główna</a></li>';
			else
				echo '<li><a href="index.php">Strona główna</a></li>';
				
			if(isset($_SESSION['page']) && $_SESSION['page']=='hardware')
				echo '<li class="current"><a href="hardware.php">Sprzęt</a></li>';
			else
                echo '<li><a href="hardware.php">Sprzęt</a></li>';
                
            if(isset($_SESSION['page']) && $_SESSION['page']=='users')
            	echo'<li class="current"><a href="users.php">Użytkownicy</a></li>';
            else
                echo'<li><a href="users.php">Użytkownicy</a></li>';
                	
		if(AdminLogIn::IsLoggedIn()) echo'<li><a href="logout.php">WYLOGUJ</a></li>';
		echo '
            	</ul>
        	</div>
		</div>
		<div id="wrapper">';
	}
	
	public static function DisplayHeaderNoRights() {
		AdminView::PrepareHeader();
		echo '
<body>
	<div id="container">
    	<div id="header">
        	<h2>ITWorld - Admin Panel</h2>
			<div id="topmenu">
            	<ul>
                	<li class="current">Brak uprawnień</li>
                    <li>Brak uprawnień</li>
                	<li>Brak uprawnień</li>';
		if(AdminLogIn::IsLoggedIn()) echo'<li><a href="logout.php">WYLOGUJ</a></li>';
		echo'
				</ul>
			</div>
		</div>
		<div id="wrapper">';
	}
	
	public static function DisplaySidebar() {
		echo '
            <div id="sidebar">
  				<ul>
                	<li><h3><a href="index.php" class="house">Administracja</a></h3>
                        <ul>
                        	<li><a href="index.php" class="report">Strona główna</a></li>
                        </ul>
                    </li>
                    <li><h3><a href="users.php" class="user">Użytkownicy</a></h3>
          				<ul>
          					<li><a href="users.php" class="group">Zarządzaj</a></li>
          					<li><a href="users_exp.php" class="impexp">Import/export</a></li>
                        </ul>
                    </li>
                    <li><h3><a href="hardware.php" class="manage">Sprzęt</a></h3>
          				<ul>
                            <li><a href="hardware.php?type=cpu" class="manage_page">Procesory</a></li>
                            <li><a href="hardware.php?type=gpu" class="manage_page">Karty graficzne</a></li>
                            <li><a href="hardware.php?type=hdd" class="manage_page">Dyski twarde</a></li>
            				<li><a href="hardware.php?type=mnb" class="manage_page">Płyty główne</a></li>
            				<li><a href="hardware.php?type=ram" class="manage_page">Pamięci</a></li>
                        </ul>
                    </li>
					<li><h3><a href="logout.php" class="folder_table">Wylogowanie</a></h3>
          				<ul>
                            <li><a href="logout.php" class="online">Wyloguj</a></li>
                        </ul>
                    </li>
				</ul>       
			</div>';
	}
	
	public static function DisplaySidebarNoRights() {
		echo '
            <div id="sidebar">
  				<ul>
                	<li><h3><a href="#" class="house">Brak uprawnień</a></h3>
                        <ul>
                        	<li>Nie masz uprawnień do obsługi tego menu.</li>
                        </ul>
                    </li>
				</ul>       
			</div>';
	}
	
	public static function DisplayFooter() {
		echo '
		</div>
        <div id="footer">
			<div id="credits">Copyright &copy; 2010 Tomasz Biernacki &amp; Michał Grot</div>
			<div id="styleswitcher">
				<ul>
					<li><a href="javascript: document.cookie=\'theme=\'; window.location.reload();" title="Default" id="defswitch">d</a></li>
					<li><a href="javascript: document.cookie=\'theme=1\'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
					<li><a href="javascript: document.cookie=\'theme=2\'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
					<li><a href="javascript: document.cookie=\'theme=3\'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
					<li><a href="javascript: document.cookie=\'theme=4\'; window.location.reload();" title="Red" id="redswitch">r</a></li>
				</ul>
			</div><br />
        </div>
	</div>
</body>
</html>';
	}

	public static function DisplayContentNoRights() {
		echo'
            <div id="content">
                <p>Przykro nam, nie posiadasz uprawnień do przeglądania zawartości tej strony.</p>
            </div>';
	}
	
	public static function DisplayIndexContent() {
		echo'
            <div id="content">
                <p>&nbsp;</p>
                <p>Witaj w panelu administracyjnym serwisu IT World.<br>Wybierz, co chcesz zrobić spośród akcji
                dostępnych w menu.</p>
                <p>&nbsp;</p>
            </div>';
	}
	
	public static function DisplayUsersContent() {
		include_once('./dbAction/DbConn.php');
		$MyUsers = array();
		$MyConn = DbConn::GetDbConn();
		if(!is_null($MyConn)) {
			$MyResult = $MyConn->query('SELECT user_id, login, data_reg, name, surname, email FROM users');
			$MyConn->close();
			for($i = 0; $row = $MyResult->fetch_row(); $i++) {
				$MyUsers[$i] = $row;
			}
			unset($MyResult);
		}
		echo '
            <div id="content">
                <p><h2>Zarządzanie użytkownikami</h2></p>
                <p><table>
                	<tr>
                		<th>ID</th>
                		<th>Login</th>
                		<th>Data rej.</th>
                		<th>Imię/nick</th>
                		<th>Nazwisko</th>
                		<th>Adres e-mail</th>
                		<th>&nbsp;</th>
                	</tr>';
		if(count($MyUsers) == 0) {
			echo '<tr><td colspan="6">Brak użytkowników do wyświetlenia.</td></tr>';
		}
		else {
			$MyCnt = count($MyUsers);
			for($i=0; $i < $MyCnt; $i++) {
				echo '
					<tr>
						<td style="text-align:center;">' . $MyUsers[$i][0] . '</td>
						<td style="text-align:center;">' . $MyUsers[$i][1] . '</td>
						<td style="text-align:center;">' . $MyUsers[$i][2] . '</td>
						<td style="text-align:center;">' . $MyUsers[$i][3] . '</td>
						<td style="text-align:center;">' . $MyUsers[$i][4] . '</td>
						<td style="text-align:center;">' . $MyUsers[$i][5] . '</td>
						<td style="text-align:center;">
							<a href="user_edit.php?id=' . $MyUsers[$i][0] . '" class="useredit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
							<a href="./dbAction/UserDelete.php?id=' . $MyUsers[$i][0] . '" class="userdel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
						</td>
					</tr>';
			}
		}
		echo '
                </table></p>';
		if(isset($_SESSION['UserMng'])) {
			echo '<p style="font-style:italic;">' . $_SESSION['UserMng'] . '</p>';
			unset($_SESSION['UserMng']);
		}
		if(isset($_SESSION['Error'])) {
			echo '<p style="color:red;font-style:italic;"">' . $_SESSION['Error'] . '</p>';
			unset($_SESSION['Error']);
		}
		echo '
            </div>';
	}
	
	public static function DisplayUserEditContent() {
		include_once('./dbAction/DbConn.php');
		$MyUsers = array();
		$MyConn = DbConn::GetDbConn();
		if(!is_null($MyConn)) {
			$MyResult = $MyConn->query('SELECT user_id, login, data_reg, name, surname, email FROM users WHERE user_id = ' . $_GET['id']);
			$MyConn->close();
			if($MyResult) {
				$MyUser = $MyResult->fetch_row();
				unset($MyResult); 
				echo'
            <div id="content">
                <p><h2>Edycja danych użytkownika</h2></p>
                <p><form action="dbAction/UserEdit.php" method="post"><table style="width:50%;border:0px hidden;">
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">ID:</td>
                	<td><input type="text" name="UserId" readonly="readonly" value = "' . stripslashes($MyUser[0]) . '"/></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Login:</td>
                	<td><input type="text" name="UserLogin" readonly="readonly" value = "' . stripslashes($MyUser[1]) . '"/></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Data rejestracji:</td>
                	<td><input type="text" name="UserRegDate" readonly="readonly" value = "' . stripslashes($MyUser[2]) . '"/></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Hasło:</td>
                	<td><input type="password" name="UserPassword1" /></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Powtórz hasło:</td>
                	<td><input type="password" name="UserPassword2" /></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Imię:</td>
                	<td><input type="text" name="UserName" value = "' . stripslashes($MyUser[3]) . '"/></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">Nazwisko:</td>
                	<td><input type="text" name="UserSurname" value = "' . stripslashes($MyUser[4]) . '"/></td>
                </tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">E-mail:</td>
                	<td><input type="text" name="UserMail" value = "' . stripslashes($MyUser[5]) . '"/></td>
                </tr>
                <tr><td colspan="2">&nbsp;</td></tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">&nbsp;</td>
                	<td><input type="submit" name="submit" value="Wyślij"/></td>
                </tr>
            	</table></form></p>';
                echo '
                <p>&nbsp;</p>';
				if(isset($_SESSION['UserMng'])) {
					echo '<p style="font-style:italic;">' . $_SESSION['UserMng'] . '</p>';
					unset($_SESSION['UserMng']);
				}
				if(isset($_SESSION['Error'])) {
					echo '<p style="color:red;font-style:italic;">' . $_SESSION['Error'] . '</p>';
					unset($_SESSION['Error']);
				}
				echo '
            </div>';
			} else {
				echo'
            <div id="content">
                <p><h2>Edycja danych użytkownika</h2></p>
                <p>&nbsp;</p>
                <p>Przepraszamy, nie znaleziono w bazie użytkownika o wybranym numerze ID.</p>
                <p>&nbsp;</p>
            </div>';
			}
		}
	}
	
	public static function DisplayUsersExpContent() {
		echo'
            <div id="content">
                <p>&nbsp;</p>
                <p><h2>Eksport użytkowników</h2></p>
                <p>&nbsp;</p>
                <p>Lokalizacja, do której zostanie zapisany plik: C:\users.xml</p>
                <form action="dbAction/XmlSave.php" method="post">
                <table style="width:75%;border:0px hidden;">
                <tr>
                	<td style="width:55%;border:0px hidden;">&nbsp;</td>
                	<td style="width:45%;border:0px hidden;"><input type="submit" name="submit" value="Eksportuj" /></td>
                </tr>
                </table>
                </form>';
		echo '<p>&nbsp;</p>';
				if(isset($_SESSION['XmlSave'])) {
					echo '<p style="font-style:italic;">' . $_SESSION['XmlSave'] . '</p>';
					unset($_SESSION['XmlSave']);
				}
				if(isset($_SESSION['Error'])) {
					echo '<p style="color:red;font-style:italic;">' . $_SESSION['Error'] . '</p>';
					unset($_SESSION['Error']);
				}
        echo '</div>';
	}
	
	public static function DisplayHardwareContent() {
		echo'<div id="content">
                <p>&nbsp;</p>
                <p><h2>Zarządzanie sprzętem</h2>'; 
		if(isset($_GET['type'])) 
			echo '(<a href="hardware_edit.php?action=new&amp;type=' . $_GET['type'] . '">dodaj nowy</a>)'; 
		echo '</p>';
		if(!$_GET || !isset($_GET['type'])) {
			echo '
                <p>&nbsp;</p>
                <p>Wybierz interesujący Cię rodzaj sprzętu z menu po prawej stronie.</p>
                <p>&nbsp;</p>
                ';
		}
		elseif($_GET['type'] == 'cpu')
			AdminView::DisplayHardwareCpuContent();
		elseif($_GET['type'] == 'gpu')
			AdminView::DisplayHardwareGpuContent();
		elseif($_GET['type'] == 'hdd')
			AdminView::DisplayHardwareHddContent();
		elseif($_GET['type'] == 'mnb')
			AdminView::DisplayHardwareMnbContent();
		elseif($_GET['type'] == 'ram')
			AdminView::DisplayHardwareRamContent();
		else
			echo '
                <p>&nbsp;</p>
                <p style="font-style:italic;color:red;">Nieznany błąd.</p>
                <p>&nbsp;</p>
                ';
        echo '</div>';
	}
	
	public static function DisplayHardwareEditContent() {
		$MyTable = '';
		$MyFields = array();
		switch($_GET['type']) {
			case 'cpu' : $MyTable = 'processor'; $MyFields = AdminView::GetCpuFieldsArray(); break;
			case 'gpu' : $MyTable = 'graphic'; $MyFields = AdminView::GetGpuFieldsArray(); break;
			case 'mnb' : $MyTable = 'motherboard'; $MyFields = AdminView::GetMnbFieldsArray(); break;
			case 'hdd' : $MyTable = 'disk'; $MyFields = AdminView::GetHddFieldsArray(); break;
			case 'ram' : $MyTable = 'memory'; $MyFields = AdminView::GetRamFieldsArray(); break;
			default : break;
		}
		switch($_GET['action']) {
			case 'edit' : AdminView::HardwareEdit($MyTable, $MyFields); break;
			case 'new'	: AdminView::HardwareNew($MyTable, $MyFields); break;
			default		: break;
		}
	}
	
	private static function HardwareEdit($pTableName, $pFields) {
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		if(!is_null($MyConn)) {
			$MyResult = $MyConn->query('SELECT * FROM ' . $pTableName . ' WHERE ' . $pTableName . '_id = ' . $_GET['id']);
			$MyConn->close();
			if($MyResult) {
				$MyItem = $MyResult->fetch_row();
				unset($MyResult); 
				echo '<div id="content">
				<p><h2>Edycja danych sprzętu</h2></p>
                <p><form action="dbAction/HardwareEdit.php" method="post"><table style="width:50%;border:0px hidden;">';
				echo '<input type="hidden" name="ActionType" value = "' . $_GET['action'] . '"/>';
				echo '<input type="hidden" name="ItemId" value = "' . $MyItem[0] . '"/>';
				echo '<input type="hidden" name="ItemType" value = "' . $_GET['type'] . '"/>';
				foreach ($pFields as $MyText => $MyValue) {
					echo '
					<tr style="border:0px hidden;">
                		<td style="text-align:right;padding-right:10px;border:0px hidden;">' . $MyText . ':</td>
                		<td><input type="text" name="' . $_GET['type'] . $MyValue . '" value = "' . stripslashes($MyItem[$MyValue]) . '"/></td>
                	</tr>';
				}
                echo '<tr><td colspan="2">&nbsp;</td></tr>
                <tr style="border:0px hidden;">
                	<td style="text-align:right;padding-right:10px;border:0px hidden;">&nbsp;</td>
                	<td><input type="submit" name="submit" value="Wyślij"/></td>
                </tr>
                </table></form></p>';
				echo '<p>&nbsp;</p>';
				if(isset($_SESSION['HardwareMng'])) {
					echo '<p style="font-style:italic;">' . $_SESSION['HardwareMng'] . '</p>';
					unset($_SESSION['HardwareMng']);
				}
				if(isset($_SESSION['Error'])) {
					echo '<p style="color:red;font-style:italic;">' . $_SESSION['Error'] . '</p>';
					unset($_SESSION['Error']);
				}
				echo '</div>';
			} else {
				echo'
            <div id="content">
                <p><h2>Edycja danych sprzętu</h2></p>
                <p>&nbsp;</p>
                <p>Przepraszamy, nie znaleziono w bazie sprzętu o wybranym numerze ID.</p>
                <p>&nbsp;</p>
            </div>';
			}
		}
	}
	
	private static function HardwareNew($pTableName, $pFields) {
		echo '<div id="content">
		<p><h2>Edycja danych sprzętu</h2></p>
        <p><form action="dbAction/HardwareEdit.php" method="post"><table style="width:50%;border:0px hidden;">';
		echo '<input type="hidden" name="ActionType" value = "' . $_GET['action'] . '" />';
		echo '<input type="hidden" name="ItemId" value = "-1" />';
		echo '<input type="hidden" name="ItemType" value = "' . $_GET['type'] . '" />';
		foreach ($pFields as $MyText => $MyValue) {
			echo '
			<tr style="border:0px hidden;">
                <td style="text-align:right;padding-right:10px;border:0px hidden;">' . $MyText . ':</td>
                <td><input type="text" name="' . $_GET['type'] . $MyValue . '" /></td>
            </tr>';
		}
        echo '<tr><td colspan="2">&nbsp;</td></tr>
        <tr style="border:0px hidden;">
        	<td style="text-align:right;padding-right:10px;border:0px hidden;">&nbsp;</td>
        	<td><input type="submit" name="submit" value="Wyślij"/></td>
        </tr>
        </table></form></p>';
		echo '<p>&nbsp;</p>';
		if(isset($_SESSION['HardwareMng'])) {
			echo '<p style="font-style:italic;">' . $_SESSION['HardwareMng'] . '</p>';
			unset($_SESSION['HardwareMng']);
		}
		if(isset($_SESSION['Error'])) {
			echo '<p style="color:red;font-style:italic;">' . $_SESSION['Error'] . '</p>';
			unset($_SESSION['Error']);
		}
		echo '</div>';
	}
	
	private static function DisplayHardwareCpuContent() {
		$MyQuery = 'SELECT * FROM processor';
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		$MyResult = $MyConn->query($MyQuery);
		$MyConn->close();
		$MyTable = AdminView::GetCpuFieldsArray();
		AdminView::PrepareHardwareData($MyTable, $MyResult, 'cpu');
	}
	
	private static function DisplayHardwareGpuContent() {
		$MyQuery = 'SELECT * FROM graphic';
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		$MyResult = $MyConn->query($MyQuery);
		$MyConn->close();
		$MyTable = AdminView::GetGpuFieldsArray();
		AdminView::PrepareHardwareData($MyTable, $MyResult, 'gpu');
	}
	
	private static function DisplayHardwareHddContent() {
		$MyQuery = 'SELECT * FROM disk';
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		$MyResult = $MyConn->query($MyQuery);
		$MyConn->close();
		$MyTable = AdminView::GetHddFieldsArray();
		AdminView::PrepareHardwareData($MyTable, $MyResult, 'hdd');
	}
	
	private static function DisplayHardwareMnbContent() {
		$MyQuery = 'SELECT * FROM motherboard';
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		$MyResult = $MyConn->query($MyQuery);
		$MyConn->close();
		$MyTable = AdminView::GetMnbFieldsArray();
		AdminView::PrepareHardwareData($MyTable, $MyResult, 'mnb');
	}
	
	private static function DisplayHardwareRamContent() {
		$MyQuery = 'SELECT * FROM memory';
		include_once('./dbAction/DbConn.php');
		$MyConn = DbConn::GetDbConn();
		$MyResult = $MyConn->query($MyQuery);
		$MyConn->close();
		$MyTable = AdminView::GetRamFieldsArray();
		AdminView::PrepareHardwareData($MyTable, $MyResult, 'ram');
	}
	
	private static function PrepareHardwareData($pTable, $pData, $pType) {
		echo '<p><table>';
		echo '<tr>';
		foreach ($pTable as $MyText => $MyValue) {
			echo '<th>' . $MyText . '</th>';
		}
		echo '<th style="width:10%;">&nbsp;</th>';
		echo '</tr>';
		for($i=0; $row = $pData->fetch_row(); $i++) {
			echo '<tr>';
			foreach ($pTable as $MyText => $MyValue) {
				echo '<td>' . $row[$MyValue] . '</td>';
			}
			echo '<td style="text-align:center;">
					<a href="hardware_edit.php?action=edit&amp;type=' . $pType . '&amp;id=' . $row[0] . '" class="anyedit">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
					<a href="./dbAction/HardwareDelete.php?type=' . $pType . '&amp;id=' . $row[0] . '" class="anydel">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
				</td>';
			echo '</tr>';
		}
		echo '</table></p>';
		if(isset($_SESSION['HardwareMng'])) {
			echo '<p style="font-style:italic;">' . $_SESSION['HardwareMng'] . '</p>';
			unset($_SESSION['HardwareMng']);
		}
		if(isset($_SESSION['Error'])) {
			echo '<p style="color:red;font-style:italic;"">' . $_SESSION['Error'] . '</p>';
			unset($_SESSION['Error']);
		}
	}
	
	public static function GetCpuFieldsArray() {
		$MyTable = array(	'Nazwa' => 1,
							'Typ' => 2,
							'Liczba rdzeni' => 3,
							'Złącze' => 4,
							'Częst. zegara' => 5,
							'Technologia [u]' => 6,
							'Moc [W]' => 7,
							'L1 Cache [kB]' => 8,
							'L2 Cache [kB]' => 9,
							'L3 Cache [kB]' => 10
						);	
		return $MyTable;
	}

	public static function GetGpuFieldsArray() {
		$MyTable = array(	'Nazwa' => 1,
							'Producent chipsetu' => 2,
							'Chipset (rodzina)' => 3,
							'Typ chipsetu' => 4,
							'Typ złącza' => 5,
							'Częst. RAMDAC' => 6,
							'Rodzaj pamięci' => 7,
							'Częst. pamięci' => 8,
							'Taktowanie rdzenia' => 9,
							'Max. rozdzielczość' => 10
						);
		return $MyTable;
	}

	public static function GetHddFieldsArray() {
		$MyTable = array(	'Nazwa' => 1,
							'Kategoria' => 2,
							'Pojemność' => 3,
							'Interfejs' => 4,
							'Prędkość obrotowa' => 5,
							'Wymiary' => 6,
							'Waga' => 7,
							'Pamięć Cache' => 8
					 	);
	 	return $MyTable;
	}
	
	public static function GetMnbFieldsArray() {
		$MyTable = array(	'Nazwa' => 1,
							'Rodzaj slotu' => 2,
							'Typ procesora' => 3,
							'Standard' => 4,
							'Producent Chipsetu' => 5,
							'Typ Chipsetu' => 6,
							'Rodzaj pamięci' => 7,
							'Max. rozmiar pamięci' => 8,
							'Liczba gniazd pamięci' => 9,
							'Wbudowany RAID' => 10
						);
		return $MyTable;
	}
	
	public static function GetRamFieldsArray() {
		$MyTable = array(	'Nazwa' => 1,
							'Rodzaj' => 2,
							'Pojemność' => 3,
							'Max. taktowanie [MHz]' => 4,
							'Napięcie [V]' => 5,
							'Liczba pin' => 6
						);
		return $MyTable;
	}
}
?>